const novels = {
  state: {
    urls: ['https://acfun.leanapp.cn/', 'https://api.gakki.cf/'],
    url: 'https://acfun.leanapp.cn/',
    book: {}
  },
  mutations: {
    SWITCH_URL: (state, index) => {
      state.url = state.urls[index]
    },
    STORE_BOOK: (state, book) => {
      state.book = book
    }
  },
  actions: {
    switchUrl: ({ commit }, index) => {
      commit('SWITCH_URL', index)
    },
    storeBook: ({ commit }, book) => {
      commit('STORE_BOOK', book)
    }
  }
}

export default novels
